<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>方法</title>
</head>
<body>
<script>
    //1.无参无返回值方法
    function f1() {
     console.log(12);
    }
    f1();
    //2.有参无返回值方法
    function f2(x) {
        console.log(x+1);
    }
    f2(3);
    //3.无参有返回值方法
    function f3() {
        return "sd";
    }
    let value=f3();
    console.log(value);
    //4.有参有返回值方法
    function f4(x, y) {
        return x*y;
    }
    let result=f4(5,4);
    console.log(result);
</script>
</body>
</html>